package generation.classDiagram.aspect;  
    import generation.classDiagram.services.*;

    
public aspect Coche {
  
  
	pointcut insertLog(Object obj, CocheDAO targ): call (public void insert*(..)) && args(obj) && target(targ);
	
	before(Object obj,CocheDAO targ):insertLog(obj, targ) {
		System.out.println("Del pointcut: Antes del insert "+ targ +" quiere meter un objeto ");
	}
		
	after(Object obj,CocheDAO targ):insertLog(obj, targ) {
		System.out.println("Del pointcut: Se ha añadido " + obj +"
");
	}


	pointcut updateLog(Object obj,CocheDAO targ): call (public void update*(..)) && args(obj) && target(targ);
	
	before(Object obj,CocheDAO targ):updateLog(obj, targ) {
		System.out.println("Del pointcut: Antes del update "+ targ +" quiere modificar un objeto ");
	}
		
	after(Object obj,CocheDAO targ):updateLog(obj, targ) {
		System.out.println("Del pointcut: Se ha modificado " + obj+"
");
	}

	
	
	
	pointcut deleteLog(Object obj,CocheDAO targ): call (public void delete*(..)) && args(obj) && target(targ);
	
	before(Object obj,CocheDAO targ):deleteLog(obj, targ) {
		System.out.println("Del pointcut: Antes del delete "+ targ +" quiere eliminar un objeto ");
	}
		
	after(Object obj,CocheDAO targ):deleteLog(obj, targ) {
		System.out.println("Del pointcut: Se ha eliminado " + obj+"
");
	}

	pointcut selectLog(Object obj,CocheDAO targ): call (public * select*(..)) && args(obj) && target(targ);
	
	before(Object obj,CocheDAO targ):selectLog(obj, targ) {
		System.out.println("Del pointcut: Antes del select "+ targ +" quiere consultar un objeto ");
	}
		
	after(Object obj,CocheDAO targ) returning: selectLog(obj, targ) {
		System.out.println("Del pointcut: Se ha consultado " + targ +"
");
	}
}
  